/*  1:   */ package com.atomikos.icatch.imp;
/*  2:   */ 
/*  3:   */ import com.atomikos.icatch.CompositeTransaction;
/*  4:   */ import com.atomikos.icatch.CompositeTransactionManager;
/*  5:   */ import com.atomikos.icatch.SubTxAwareParticipant;
/*  6:   */ import com.atomikos.icatch.system.Configuration;
/*  7:   */ 
/*  8:   */ public class ResumePreviousTransactionSubTxAwareParticipant
/*  9:   */   implements SubTxAwareParticipant
/* 10:   */ {
/* 11:   */   private CompositeTransaction previous;
/* 12:   */   
/* 13:   */   public ResumePreviousTransactionSubTxAwareParticipant(CompositeTransaction previous)
/* 14:   */   {
/* 15:51 */     if (previous == null) {
/* 16:52 */       throw new IllegalArgumentException("Previous transaction is null?");
/* 17:   */     }
/* 18:53 */     this.previous = previous;
/* 19:   */   }
/* 20:   */   
/* 21:   */   private void resume()
/* 22:   */   {
/* 23:58 */     CompositeTransactionManager ctm = Configuration.getCompositeTransactionManager();
/* 24:60 */     if (ctm == null) {
/* 25:61 */       Configuration.logWarning("ResumePreviousTransactionSubTxAwareParticipant: no transaction manager found?");
/* 26:   */     } else {
/* 27:   */       try
/* 28:   */       {
/* 29:65 */         ctm.resume(this.previous);
/* 30:   */       }
/* 31:   */       catch (Exception error)
/* 32:   */       {
/* 33:68 */         Configuration.logWarning("ResumePreviousTransactionSubTxAwareParticipant: could not resume previous transaction", error);
/* 34:   */       }
/* 35:   */     }
/* 36:   */   }
/* 37:   */   
/* 38:   */   public void committed(CompositeTransaction tx)
/* 39:   */   {
/* 40:76 */     resume();
/* 41:   */   }
/* 42:   */   
/* 43:   */   public void rolledback(CompositeTransaction tx)
/* 44:   */   {
/* 45:82 */     resume();
/* 46:   */   }
/* 47:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions\3.7.0\transactions-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.imp.ResumePreviousTransactionSubTxAwareParticipant
 * JD-Core Version:    0.7.0.1
 */